\ Our key
0 Value encryptionKey

\ Max value of our key
256 Value keyMax

\ Set key
: SET_KEY ( n -- ) keyMax MOD to encryptionKey ;

\ Get key
: GET_KEY ( -- ) encryptionKey ;

\ Sets the keymax to a new value greater than 0
: SET_KEYMAX ( n -- ) dup 
	0 > IF
		to keyMax
	ELSE
		drop
	ENDIF ;
	
\ Generates a key capped by our keyMax value
: GENERATE_KEY ( -- ) rnd keyMax MOD to encryptionKey ;
